package edu.towson.cosc603.coffeemaker;

import junit.framework.TestCase;

public class RecipeTest extends TestCase {

	private Recipe rm;
	protected void setUp() throws Exception {
		super.setUp();
		rm = new Recipe();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testGetAmtChocolate() {
		rm.setAmtChocolate(1);
		assertEquals(rm.getAmtChocolate(),1);
	}

	public void testSetAmtChocolate() {
		rm.setAmtChocolate(1);
		assertEquals(rm.getAmtChocolate(),1);
	}
	public void testSetAmtChocolateInvalid() {
		rm.setAmtChocolate(-1);
		assertEquals(rm.getAmtChocolate(),0);
	}

	public void testGetAmtCoffee() {
		rm.setAmtCoffee(1);
		assertEquals(rm.getAmtCoffee(),1);
	}

	public void testSetAmtCoffee() {
		rm.setAmtCoffee(1);
		assertEquals(rm.getAmtCoffee(),1);
	}
	public void testSetAmtCoffeeInvalid() {
		rm.setAmtCoffee(-1);
		assertEquals(rm.getAmtCoffee(),0);
	}

	public void testGetAmtMilk() {
		rm.setAmtMilk(1);
		assertEquals(rm.getAmtMilk(),1);
	}

	public void testSetAmtMilk() {
		rm.setAmtMilk(1);
		assertEquals(rm.getAmtMilk(),1);
	}
	public void testSetAmtMilkInvalid() {
		rm.setAmtMilk(-1);
		assertEquals(rm.getAmtMilk(),0);
	}

	public void testGetAmtSugar() {
		rm.setAmtSugar(1);
		assertEquals(rm.getAmtSugar(),1);
	}

	public void testSetAmtSugar() {
		rm.setAmtSugar(1);
		assertEquals(rm.getAmtSugar(),1);
	}
	public void testSetAmtSugarInvalid() {
		rm.setAmtSugar(-1);
		assertEquals(rm.getAmtSugar(),0);
	}

	public void testGetName() {
		rm.setName("Wine");
		assertEquals(rm.getName(),"Wine");
	}

	public void testSetName() {
		rm.setName("Wine");
		assertEquals(rm.getName(),"Wine");
	}

	public void testGetPrice() {
		rm.setPrice(1);
		assertEquals(rm.getPrice(),1);
	}

	public void testSetPrice() {
		rm.setPrice(1);
		assertEquals(rm.getPrice(),1);
	}

	public void testSetPriceInvalid() {
		rm.setPrice(-1);
		assertEquals(rm.getPrice(),0);
	}
	public void testEqualsRecipe() {
		rm.setPrice(1);
		rm.setName("Wine");
		rm.setAmtSugar(1);
		Recipe rm2 = new Recipe();
		rm2.setPrice(1);
		rm2.setName("Wine");
		rm2.setAmtSugar(1);
		assertTrue(rm.equals(rm2));
		Recipe rm3 = new Recipe();
		rm3.setPrice(1);
		rm3.setName(null);
		rm3.setAmtSugar(1);
		assertFalse(rm3.equals(rm));
	}

	public void testToString() {
		rm.setPrice(1);
		rm.setName("Wine");
		rm.setAmtSugar(1);
		assertNotNull(rm.toString());
	}

}
